package com.mm.util.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 注入防护开关工具类
 *
 * @author yl
 */
@Component
public class CrosXssFilterConfigUtil {

    /**
     * 注入防护开关配置
     */
    public static Boolean openFilter;

    /**
     * 注入防护开关配置，默认为开启
     */
    public static Boolean getOpenFilterProtect() {
        return openFilter == null ? true : openFilter;
    }

    @Value("${api.filter}")
    public void setOpenFilter(Boolean openFilter) {
        CrosXssFilterConfigUtil.openFilter = openFilter;
    }
}
